package file;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author shxl2021
 * @Date 2023/8/14 9:58
 * @Version 1.0
 */
public class FileExists {
    private static final String path = "C:\\Users\\LENOVO\\AppData\\Roaming\\JetBrains\\IntelliJIdea2022.3\\scratches\\type-node\\archivemerge\\合并进程\\尚未合并文件";

    public static void main(String[] args) throws IOException {
        File file = new File(path);
        FileReader fileReader = new FileReader(file);
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        String s = null;
        List<String> list = new ArrayList<>();
        while ((s = bufferedReader.readLine()) != null) {
            //System.out.println(s.replace("C:\\Datas\\E9\\9.00.2106.02_sharding","C:\\Datas\\E9\\ecology"));
            String replace = s.replace("C:\\Datas\\E9\\9.00.2106.02_sharding", "C:\\Datas\\E9\\ecology");
            File targerFile = new File(replace);
            if (!targerFile.exists()) {
                System.out.println(replace);
            }
        }
        list.stream().sorted().forEach(System.out::println);
    }
}
